/**
 *
 * @author T-Complement
 */
package iuTaxSimula;

import java.awt.GridLayout;
import java.util.ArrayList;
import javax.swing.JButton;
import mnTaxSimula.Taxi;


public class PantallaOperadora extends javax.swing.JFrame {

    private GenerarReporteTaxi generarReporteTaxi;
    private GenerarReporteGeneral generarReporteGeneral;
    private RecibirLlamada recibirLlamada;
    private GraficarPantallaOperadora graficarPantallaOperadora;
    private PantallaTaxi pantallaTaxi;
    private int cantidadCalles;
    private int cantidadCarreras;
    private int cantidadTaxis;
    private ArrayList<Taxi> listaTaxis;

    private JButton taxis[];

    /** Creates new form PantallaOperadora */
    public PantallaOperadora(ArrayList<Taxi> listaTaxis, int cantidadCalles, int cantidadCarreras, int cantidadTaxis) {
        initComponents();
        this.listaTaxis = listaTaxis;
        this.cantidadCalles = cantidadCalles;
        this.cantidadCarreras = cantidadCarreras;
        this.cantidadTaxis = cantidadTaxis;
        mostrarTaxis();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelPantallaOperadoraPpal = new javax.swing.JPanel();
        jLabelPantallaOperadora1 = new javax.swing.JLabel();
        jLabelPantallaOperadora2 = new javax.swing.JLabel();
        jPanelPantallaOperadoraLlamadas = new javax.swing.JPanel();
        jButtonPantallaOperadoraRecibirLlamada = new javax.swing.JButton();
        jLabelPantallaOperadora3 = new javax.swing.JLabel();
        jTextFieldPantallaOperadoraTel = new javax.swing.JTextField();
        jPanelPantallaOperadoraGestionar = new javax.swing.JPanel();
        jButtonPantallaOperadoraGestTaxi = new javax.swing.JButton();
        jButtonPantallaOperadoraGestUsuario = new javax.swing.JButton();
        jPanelPantallaOperadoraReportes = new javax.swing.JPanel();
        jButtonPantallaOperadoraRepGenerales = new javax.swing.JButton();
        jButtonPantallaOperadoraRepTaxi = new javax.swing.JButton();
        jPanelPantallaOperadoraSimulacion = new javax.swing.JPanel();
        jButtonPantallaOperadoraSalirSimulacion = new javax.swing.JButton();
        jPanelCiudad = new javax.swing.JPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabelPantallaOperadora1.setFont(new java.awt.Font("Tahoma", 1, 36));
        jLabelPantallaOperadora1.setText("TaxSiMuLa");

        jLabelPantallaOperadora2.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabelPantallaOperadora2.setText("Taxi Listo S.A");

        jPanelPantallaOperadoraLlamadas.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Llamadas", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12))); // NOI18N

        jButtonPantallaOperadoraRecibirLlamada.setText("Recibir Llamada");
        jButtonPantallaOperadoraRecibirLlamada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonPantallaOperadoraRecibirLlamadaActionPerformed(evt);
            }
        });

        jLabelPantallaOperadora3.setText("Teléfono:");

        jTextFieldPantallaOperadoraTel.setEnabled(false);

        javax.swing.GroupLayout jPanelPantallaOperadoraLlamadasLayout = new javax.swing.GroupLayout(jPanelPantallaOperadoraLlamadas);
        jPanelPantallaOperadoraLlamadas.setLayout(jPanelPantallaOperadoraLlamadasLayout);
        jPanelPantallaOperadoraLlamadasLayout.setHorizontalGroup(
            jPanelPantallaOperadoraLlamadasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPantallaOperadoraLlamadasLayout.createSequentialGroup()
                .addGroup(jPanelPantallaOperadoraLlamadasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelPantallaOperadoraLlamadasLayout.createSequentialGroup()
                        .addGap(25, 25, 25)
                        .addComponent(jButtonPantallaOperadoraRecibirLlamada))
                    .addGroup(jPanelPantallaOperadoraLlamadasLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabelPantallaOperadora3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextFieldPantallaOperadoraTel, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanelPantallaOperadoraLlamadasLayout.setVerticalGroup(
            jPanelPantallaOperadoraLlamadasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPantallaOperadoraLlamadasLayout.createSequentialGroup()
                .addComponent(jButtonPantallaOperadoraRecibirLlamada)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanelPantallaOperadoraLlamadasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelPantallaOperadora3)
                    .addComponent(jTextFieldPantallaOperadoraTel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jPanelPantallaOperadoraGestionar.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Gestionar", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12))); // NOI18N

        jButtonPantallaOperadoraGestTaxi.setText("Taxis");
        jButtonPantallaOperadoraGestTaxi.setToolTipText("Usuarios");

        jButtonPantallaOperadoraGestUsuario.setText("Usuarios");

        javax.swing.GroupLayout jPanelPantallaOperadoraGestionarLayout = new javax.swing.GroupLayout(jPanelPantallaOperadoraGestionar);
        jPanelPantallaOperadoraGestionar.setLayout(jPanelPantallaOperadoraGestionarLayout);
        jPanelPantallaOperadoraGestionarLayout.setHorizontalGroup(
            jPanelPantallaOperadoraGestionarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPantallaOperadoraGestionarLayout.createSequentialGroup()
                .addGap(43, 43, 43)
                .addGroup(jPanelPantallaOperadoraGestionarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jButtonPantallaOperadoraGestTaxi, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonPantallaOperadoraGestUsuario, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(38, Short.MAX_VALUE))
        );
        jPanelPantallaOperadoraGestionarLayout.setVerticalGroup(
            jPanelPantallaOperadoraGestionarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelPantallaOperadoraGestionarLayout.createSequentialGroup()
                .addComponent(jButtonPantallaOperadoraGestTaxi)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButtonPantallaOperadoraGestUsuario))
        );

        jPanelPantallaOperadoraReportes.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Reportes", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12))); // NOI18N

        jButtonPantallaOperadoraRepGenerales.setText("Generales");

        jButtonPantallaOperadoraRepTaxi.setText("Por Taxi");

        javax.swing.GroupLayout jPanelPantallaOperadoraReportesLayout = new javax.swing.GroupLayout(jPanelPantallaOperadoraReportes);
        jPanelPantallaOperadoraReportes.setLayout(jPanelPantallaOperadoraReportesLayout);
        jPanelPantallaOperadoraReportesLayout.setHorizontalGroup(
            jPanelPantallaOperadoraReportesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelPantallaOperadoraReportesLayout.createSequentialGroup()
                .addGap(38, 38, 38)
                .addGroup(jPanelPantallaOperadoraReportesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButtonPantallaOperadoraRepTaxi, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE)
                    .addComponent(jButtonPantallaOperadoraRepGenerales, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(35, 35, 35))
        );
        jPanelPantallaOperadoraReportesLayout.setVerticalGroup(
            jPanelPantallaOperadoraReportesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPantallaOperadoraReportesLayout.createSequentialGroup()
                .addComponent(jButtonPantallaOperadoraRepGenerales)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButtonPantallaOperadoraRepTaxi))
        );

        jPanelPantallaOperadoraSimulacion.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Simulacion", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12))); // NOI18N

        javax.swing.GroupLayout jPanelPantallaOperadoraSimulacionLayout = new javax.swing.GroupLayout(jPanelPantallaOperadoraSimulacion);
        jPanelPantallaOperadoraSimulacion.setLayout(jPanelPantallaOperadoraSimulacionLayout);
        jPanelPantallaOperadoraSimulacionLayout.setHorizontalGroup(
            jPanelPantallaOperadoraSimulacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 154, Short.MAX_VALUE)
        );
        jPanelPantallaOperadoraSimulacionLayout.setVerticalGroup(
            jPanelPantallaOperadoraSimulacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        jButtonPantallaOperadoraSalirSimulacion.setText("Salir Simulacion");

        javax.swing.GroupLayout jPanelCiudadLayout = new javax.swing.GroupLayout(jPanelCiudad);
        jPanelCiudad.setLayout(jPanelCiudadLayout);
        jPanelCiudadLayout.setHorizontalGroup(
            jPanelCiudadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 390, Short.MAX_VALUE)
        );
        jPanelCiudadLayout.setVerticalGroup(
            jPanelCiudadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 338, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanelPantallaOperadoraPpalLayout = new javax.swing.GroupLayout(jPanelPantallaOperadoraPpal);
        jPanelPantallaOperadoraPpal.setLayout(jPanelPantallaOperadoraPpalLayout);
        jPanelPantallaOperadoraPpalLayout.setHorizontalGroup(
            jPanelPantallaOperadoraPpalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPantallaOperadoraPpalLayout.createSequentialGroup()
                .addGroup(jPanelPantallaOperadoraPpalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelPantallaOperadoraPpalLayout.createSequentialGroup()
                        .addGap(71, 71, 71)
                        .addComponent(jPanelCiudad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelPantallaOperadoraPpalLayout.createSequentialGroup()
                        .addGap(170, 170, 170)
                        .addComponent(jLabelPantallaOperadora1))
                    .addGroup(jPanelPantallaOperadoraPpalLayout.createSequentialGroup()
                        .addGap(222, 222, 222)
                        .addComponent(jButtonPantallaOperadoraSalirSimulacion)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPantallaOperadoraPpalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelPantallaOperadoraPpalLayout.createSequentialGroup()
                        .addGap(153, 153, 153)
                        .addGroup(jPanelPantallaOperadoraPpalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jPanelPantallaOperadoraReportes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanelPantallaOperadoraGestionar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanelPantallaOperadoraLlamadas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanelPantallaOperadoraSimulacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(182, 182, 182))
                    .addGroup(jPanelPantallaOperadoraPpalLayout.createSequentialGroup()
                        .addGap(197, 197, 197)
                        .addComponent(jLabelPantallaOperadora2)
                        .addContainerGap())))
        );
        jPanelPantallaOperadoraPpalLayout.setVerticalGroup(
            jPanelPantallaOperadoraPpalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPantallaOperadoraPpalLayout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addGroup(jPanelPantallaOperadoraPpalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanelPantallaOperadoraPpalLayout.createSequentialGroup()
                        .addComponent(jLabelPantallaOperadora2)
                        .addGap(45, 45, 45)
                        .addComponent(jPanelPantallaOperadoraLlamadas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(9, 9, 9)
                        .addComponent(jPanelPantallaOperadoraGestionar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanelPantallaOperadoraReportes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanelPantallaOperadoraSimulacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelPantallaOperadoraPpalLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabelPantallaOperadora1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanelCiudad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButtonPantallaOperadoraSalirSimulacion)))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelPantallaOperadoraPpal, javax.swing.GroupLayout.PREFERRED_SIZE, 824, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelPantallaOperadoraPpal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonPantallaOperadoraRecibirLlamadaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPantallaOperadoraRecibirLlamadaActionPerformed
        //***********controlTotal.recibirLlamada();
    }//GEN-LAST:event_jButtonPantallaOperadoraRecibirLlamadaActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonPantallaOperadoraGestTaxi;
    private javax.swing.JButton jButtonPantallaOperadoraGestUsuario;
    private javax.swing.JButton jButtonPantallaOperadoraRecibirLlamada;
    private javax.swing.JButton jButtonPantallaOperadoraRepGenerales;
    private javax.swing.JButton jButtonPantallaOperadoraRepTaxi;
    private javax.swing.JButton jButtonPantallaOperadoraSalirSimulacion;
    private javax.swing.JLabel jLabelPantallaOperadora1;
    private javax.swing.JLabel jLabelPantallaOperadora2;
    private javax.swing.JLabel jLabelPantallaOperadora3;
    private javax.swing.JPanel jPanelCiudad;
    private javax.swing.JPanel jPanelPantallaOperadoraGestionar;
    private javax.swing.JPanel jPanelPantallaOperadoraLlamadas;
    private javax.swing.JPanel jPanelPantallaOperadoraPpal;
    private javax.swing.JPanel jPanelPantallaOperadoraReportes;
    private javax.swing.JPanel jPanelPantallaOperadoraSimulacion;
    private javax.swing.JTextField jTextFieldPantallaOperadoraTel;
    // End of variables declaration//GEN-END:variables

    /*
    * @param
    * @pre
    * @pos
    * @exception
    */
    public void mostrarTaxis(){
       jPanelCiudad.setLayout(new GridLayout(10, 10));
        taxis = new JButton[cantidadTaxis];
        for(int i = 0; i < cantidadTaxis; i++)
        {
            taxis[i] = new JButton();
            //taxis[i].setIcon(new javax.swing.ImageIcon(getClass().getResource("/defaultpackage/Taxi.jpg"))); // NOI18N
            taxis[i].setText("PLACA: " + listaTaxis.get(i).getPlaca() + " (" + listaTaxis.get(i).getCalle() + ", " + listaTaxis.get(i).getCarrera() + ")");
            jPanelCiudad.add(taxis[i]);
        }
    }
}
